begintownscript;

 begintownscript;	

 variables;
int i,j,k,r1,choice;
body;
beginstate INIT_STATE;

	set_flag(110,3,5);
	set_flag(7,7,1);

	force_instant_terrain_redraw();
	message_dialog("You see a furious swarm of ogres attacking the Passton north gate. Many of their kin have already been pierced by arrows and fallen down. The ground is peppered with a lot of arrows considering there were only four bowmen in Passton.","There is another group closer to you. Apparently they are the reserve. These ogres were so enthralled by the fighting that you were able to sneak very close to them before one of them turned around, saw you and roared aloud.");

	 break;	

beginstate START_STATE;
	if ((get_flag(7,1) == 1) && (num_chars_in_group(1) == 0)) {
		reset_dialog();
		add_dialog_str(0,"The last of the ogres has fallen. The survivors of the Passton garrison erupt in an ecstatic cheer. All but Ereleno the priest who was providing healing for the soldiers. All he does is snort. _It was god's will._",0);
		add_dialog_str(1,"Then he leaves back to his shrine. A soldier or two walks up to you and slaps your back merrily. A soldier in a half plate waits for the others to leave before walking closer. You do not think you have seen this soldier before.",0);
		add_dialog_str(2,"The helmet is removed, revealing a face covered in long blond tresses. She shakes them from her face and reveals herself as mayor Tallen. _Good work! I'm not sure we would have held if it wasn't for you._",0);
		add_dialog_str(3,"_Now we need to discuss our next move. Meet me at the town hall._ Then mayor grins one more time and leaves.",0);
		run_dialog(1);
		award_party_xp(75,15);
		set_flag(7,1,5);
		erase_char(18);
		relocate_character(25,35,43);
		set_mobility(25,0);
}
break;	

beginstate EXIT_STATE;
break;

beginstate 10;
	if (get_flag(7,1) >= 1)
		end();

	message_dialog("The battle rages in front of you.","");
	activate_hidden_group(1);
	set_total_visibility(1);
	force_view_center(23,21);
force_instant_terrain_redraw();
	pause(3);
	force_view_center(23,23);
force_instant_terrain_redraw();
	pause(3);
	force_view_center(23,25);
force_instant_terrain_redraw();
	pause(3);
	force_view_center(23,29);
force_instant_terrain_redraw();
	pause(18);
	message_dialog("It's hard to tell who is winning. The ogres clearly outnumber the Passton garrison, but on the other hand the ogres do not seem very organized. A mage is trying to infuse order on the ogres, but they are too far gone in their bloodlust.","At any rate, it does not look they will be routed any time soon.");
	if (char_ok(40) == TRUE)
		erase_char(40);
	set_flag(7,1,1);
	force_view_center(char_loc_x(0),char_loc_y(0));
	set_total_visibility(0);
	force_instant_terrain_redraw();
	add_char_to_group(26,1);
	add_char_to_group(27,1);
	add_char_to_group(28,1);
	add_char_to_group(29,1);
	add_char_to_group(30,1);
	add_char_to_group(31,1);
	add_char_to_group(32,1);
	add_char_to_group(33,1);
	add_char_to_group(34,1);
	add_char_to_group(35,1);
	add_char_to_group(36,1);
	add_char_to_group(37,1);
	add_char_to_group(38,1);
	add_char_to_group(39,1);
//Defenders
	add_char_to_group(14,2);
	add_char_to_group(15,2);
	add_char_to_group(16,2);
	add_char_to_group(17,2);
	add_char_to_group(18,2);
	add_char_to_group(19,2);
	add_char_to_group(20,2);
	add_char_to_group(21,2);
	add_char_to_group(22,2);
	add_char_to_group(23,2);
	add_char_to_group(24,2);
	add_char_to_group(25,2);
	set_name(18,"Veteran soldier");
	alert_char(1002);
 break;

beginstate 11;
	set_town_visibility(7,0);
	move_to_new_town(0,18,22);
 break;

beginstate 12;
	block_entry(1);
	message_dialog("You cannot leave the area now! A battle is raging at the very gates of Passton! You must repel the invaders and go to the town hall when you are done. Mayor Tallen will surely want to talk to you.","The people of Passton need your help.");
 break;
